package com.example.dish.controller;

import com.example.admin_api.EmployeeClient;
import com.example.admin_model.dto.EmployeeDTO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: sjz
 * @since: 2024/7/3 20:19
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    @Resource
    private EmployeeClient employeeClient;

    @PostMapping
    public void test(){
        String token="eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoi566h55CG5ZGYIiwiYWRtaW5JZCI6IjEiLCJpYXQiOjE3MjAwNTA3NDAsImV4cCI6MjU4NDA1MDc0MH0.gEH5LM3j865Nb-Cij6mWIU8B4yxxhrrlb-QvlsxtftM";
        EmployeeDTO dto=new EmployeeDTO();
        dto.setToken(token);
        String id = employeeClient.validate(dto);
        log.info("id:{}",id);
        System.out.println(id);
    }
}
